package com.example.springbase;

import com.example.springbase.test.AutowireMode.UserDao1;
import com.example.springbase.test.ConditionalOnMissingBean.PersonMapper;
import com.example.springbase.test.ImportBeanDefinitionRegistrar.TestBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TestController
 *
 * @author zhouxianfeng
 * @date 2021-4-12
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestBean testBean;

    @Autowired
    private UserDao1 userDao1;

    @Autowired
    private PersonMapper personMapper;

    @GetMapping("")
    public TestBean test() {
        return testBean;
    }

    @GetMapping("/mode")
    public UserDao1 mode() {
        return userDao1;
    }

    @GetMapping("/pmapper")
    public PersonMapper personMapper() {
        return personMapper;
    }

}
